import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      component: () => import("@/views/index.vue"),
      redirect: "/zonglan",
      children: [
        {
          path: "/zonglan",
          name: "zonglan",
          meta: {
            title: "总览",
            icon: "HomeFilled",
          },
          component: () => import("@/views/layout/zonglan/index.vue"),
        },
        {
          path: "/wendang",
          name: "wendang",
          meta: {
            title: "文档",
            icon: "Document",
          },
          component: () => import("@/views/layout/wendang/index.vue"),
        },
        {
          path: "/video",
          name: "video",
          meta: {
            title: "视频",
            icon: "User",
          },
          component: () => import("@/views/layout/video/index.vue"),
        },
        {
          path: "/article",
          name: "article",
          meta: {
            title: "文章",
            icon: "User",
          },
          component: () => import("@/views/layout/article/index.vue"),
        },
        {
          path: "/loading",
          name: "loading",
          meta: {
            title: "loading",
            icon: "User",
          },
          component: () => import("@/views/layout/loading/index.vue"),
        },
        {
          path: "/users",
          name: "users",
          meta: {
            title: "用户",
            icon: "User",
          },
          component: () => import("@/views/layout/users/index.vue"),
        },
      ],
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/login/login.vue"),
    },
  ],
});

export default router;
